#!/usr/bin/python
# -*- mode:python; coding:utf-8 -*-

# find robust features in the image

# NOTE: see https://code.ros.org/trac/opencv/ticket/373 if get
#  "cv.error: Non-positive width or height"

import cv
import sys

if len(sys.argv) != 2:
    print "Usage: %s <image>" % sys.argv[0]
    sys.exit(1)

im = cv.LoadImage(sys.argv[1], cv.CV_LOAD_IMAGE_GRAYSCALE)
keys = cv.ExtractSURF(im, None, cv.CreateMemStorage(), (0, 300, 3, 2))[0]
for ((x,y), laplacian, size, orient, hessian) in keys:
    cv.Circle(im, (int(x), int(y)), size/2, 125)

cv.NamedWindow("Test 05")
cv.StartWindowThread()
cv.ShowImage("Test 05", im)
cv.WaitKey()






